<?php
use yii\helpers\Url;
$data_matrix = "https://proxcrm.xgate.com/barcode/frontend/web/index.php?r=qr/barcode&code=;" . $userInfo['card_number'] . "&type=qrcode";
$this->title = '会员中心';
?>

<div class="topContainer">
    <div class="weui-flex">
        <div class="weui-flex-item card" id="card">
            <?php if($userInfo['title'] == '004'){?>
            <img src="<?= Url::to('@web/momo/img/momo_card.png' ,true)?>" alt="">
            <?php } ?>
            <?php if($userInfo['title'] == '001' || $userInfo['title'] == '002'){?>
<!--                <img src="--><?//= Url::to('@web/momo/img/momo_saveCard2.png' ,true)?><!--" alt="">-->
                <img src="<?= Url::to('@web/momo/img/momo_new.png' ,true)?>" alt="">
            <?php } ?>
            <div class="qrcode">
                <?php if($userInfo['title'] == '004'){?>
                <img src="<?= Url::to('@web/momo/img/qrCode2.png' ,true)?>" alt="">
                <?php } ?>
                <?php if($userInfo['title'] == '001' || $userInfo['title'] == '002'){?>
                <img src="<?= Url::to('@web/momo/img/saveQrcode.png' ,true)?>" alt="">
                <?php } ?>
            </div>
            <P class="getCardNo">NO.<span ><?= $userInfo['code']?></span></P>
        </div>
    </div>
    <div class="weui_msg_img hide" id="barCard" onclick="$('#barCard').fadeOut();">
        <div class="weui_msg_com">

            <div class="logo">
                <img src="<?= Url::to('@web/momo/img/logo.png' ,true)?>">
            </div>
            <p class="prompt">结账时请主动出示会员卡</p>
            <div class="weui_msg_src">
                <img src="<?= $data_matrix?>">
                <p ><?= $userInfo['code']?></p>
            </div>
            <!-- <p class="weui_msg_comment">长按上方二维码3秒识别二维码</p> -->

        </div>
    </div>
    <div class="weui-flex">
        <div class="weui-flex-item">
            <div class="topBox">
                <div class="topBoxHead">
                    M币
                </div>
                <div class="topBoxBody">
                    <a href="<?= Url::to(['member/points-detail'])?>" id="getNum"><?= $userInfo['points']?></a>
                </div>
            </div>
        </div>
        <!-- <div class="weui-flex-item ">
            <div class="topBox leftBorder">
                <div class="topBoxHead">
                    优惠券
                </div>
                <div class="topBoxBody">
                    <a href="coupons.html">查看</a>
                </div>
            </div>
        </div> -->
    </div>
</div>

<div class="weui_cells weui_cells_access">
    <a class="weui_cell " href="<?= Url::to(['member/view'])?>">
        <div class="weui_cell_bd weui_cell_primary">
            <p>个人信息</p>
        </div>
        <div class="weui_cell_ft">
        </div>
    </a>
    <a class="weui_cell" href="<?= Url::to(['member/card-detail'])?>">
        <div class="weui_cell_bd weui_cell_primary">
            <p>会员卡详情</p>
        </div>
        <div class="weui_cell_ft">
        </div>
    </a>
</div>


<div id="resText"></div>
</body>
</html>
<?php 
    $js = '
        $(".qrcode").click(function() {
            $("#barCard").fadeIn();
        })
        $("#card").click(function() {
            $("#barCard").fadeIn();
        })
    ';
    $this->registerJs($js, \yii\web\View::POS_END);
?>
